package com.shopping.search.controller;

import com.shopping.search.service.MallSearchService;
import com.shopping.search.vo.SearchParamVo;
import com.shopping.search.vo.SearchResultVo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;

/**
 * @author Europa
 */
@Controller
public class SearchController {

    @Resource
    MallSearchService mallSearchService;

    @GetMapping("/list.html")
    public String listPage(SearchParamVo param, Model model){
        SearchResultVo search = mallSearchService.search(param);
        model.addAttribute("result", search);
        return "list";
    }
}
